<script type="text/javascript">

/*
    $(function () {
        $('#dsgdList').combobox({
            url:$.webPath() + '/sys/dsgd/dsgdList',
            valueField:'id',
            textField:'jc',
            multiple:true,
            panelHeight:'auto',
            onLoadSuccess:function () {
                var gdIds = $("[name='gdId']").map(function () {
                    return $(this).val();
                });
                $("#dsgdList").combobox("setValues", gdIds);
            }
        });
    });
*/

    $("#doSync a[name='doBgwzbmSync']").click(function () {
        $.messager.prompt('输入', '请输入密码：', function (r) {
            if (r == '123456') {
                $.mask();
                $.post($.webPath() + "/sys/quartz/doBgwzbmSync", function (data) {
                    $.mask.hide();
                    if (data.statusCode == 200) {
                        $.messager.show({title:'提示', msg:'操作成功！', showType:'slide'});
                    } else {
                        $.messager.alert('提示', data.message, 'error');
                    }
                });
            } else {
                $.messager.alert('提示', '密码错误', 'warning');
            }
        });
    });
    $("#doSync a[name='doBgcgdSync']").click(function () {
        $.messager.prompt('输入', '请输入密码：', function (r) {
            if (r == '123456') {
                $.mask();
                $.post($.webPath() + "/sys/quartz/doBgcgdSync", function (data) {
                    $.mask.hide();
                    if (data.statusCode == 200) {
                        $.messager.show({title:'提示', msg:'操作成功！', showType:'slide'});
                    } else {
                        $.messager.alert('提示', data.message, 'error');
                    }
                });
            } else {
                $.messager.alert('提示', '密码错误', 'warning');
            }
        });
    });
    $("#doSync a[name='doPlanImport']").click(function () {
        $.messager.prompt('输入', '请输入密码：', function (r) {
            if (r == '123456') {
                $.mask();
                $.post($.webPath() + "/sys/quartz/doPlanImport", function (data) {
                    $.mask.hide();
                    if (data.statusCode == 200) {
                        $.messager.show({title:'提示', msg:'操作成功！', showType:'slide'});
                    } else {
                        $.messager.alert('提示', data.message, 'error');
                    }
                });
            } else {
                $.messager.alert('提示', '密码错误', 'warning');
            }
        });
    });
    /*$("#doSync a[name='doGdImport']").click(function () {
        if (isNaN($("#time").timespinner('getHours'))) {
            $.messager.alert('提示', "请指定定时时间!", 'error');
        } else {
            var hours = isNaN($("#time").timespinner('getHours')) ? "8" : $("#time").timespinner('getHours');
            var minutes = isNaN($("#time").timespinner('getMinutes')) ? "0" : $("#time").timespinner('getMinutes');
            var seconds = isNaN($("#time").timespinner('getSeconds')) ? "0" : $("#time").timespinner('getSeconds');
            var ids = $("#dsgdList").combobox('getValues');
            $.mask();
            $.post($.webPath() + "/sys/quartz/doGdImport?ids=" + ids, {hours:hours, minutes:minutes, seconds:seconds}, function (data) {
                $.mask.hide();
                if (data.statusCode == 200) {
                    $.messager.show({title:'提示', msg:'操作成功！', showType:'slide'});
                } else {
                    $.messager.alert('提示', data.message, 'error');
                }
            });
        }
    });*/
</script>

<div id="doSync" style="width:100%;height:100%">
    <div style="border-bottom: 1px darkgray dashed;margin-top:100px;height:25%;">
        <h2>定时挂单时间设置配置执行</h2>

        <div>
            <input id="dsgdList" class="easyui-combobox" style="width:200px;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input id="time" class="easyui-timespinner" style="width:150px;"
                   required="required" missingMessage="请输入定时时间!" data-options="min:'00:00',showSeconds:true"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:void(0)" name="doGdImport" class="easyui-linkbutton"
               data-options="iconCls:'icon-ok'">执行</a>
        </div>
    <#if (gsIds)??>
        <#list gsIds as long>
            <#if (long)??>
                <input type="hidden" name="gdId" value="${(long)!}"/>
            </#if>
        </#list>
    </#if>
    </div>
    <div style="border-bottom: 1px darkgray dashed;margin-top:100px;height:25%;">
        <h2>保供物资编码同步接口同步执行</h2>

        <div></div>
        <div><a href="javascript:void(0)" name="doBgwzbmSync" class="easyui-linkbutton"
                data-options="iconCls:'icon-ok'">执行</a></div>
    </div>
    <div style="border-bottom: 1px darkgray dashed;margin-top:100px;height:25%;">
        <h2>供应商网站同步接口同步执行</h2>

        <div></div>
        <div><a href="javascript:void(0)" name="doBgcgdSync" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">执行</a>
        </div>
    </div>
    <div style="border-bottom: 1px darkgray dashed;margin-top:100px;height:25%;">
        <h2>保供计划同步接口同步执行</h2>

        <div></div>
        <div><a href="javascript:void(0)" name="doPlanImport" class="easyui-linkbutton"
                data-options="iconCls:'icon-ok'">执行</a></div>
    </div>
</div>